package com.heima.model.wemedia.dtos;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("管理端分页查询频道相关参数")
public class WmChannelDto {

    @ApiModelProperty("查询关键字")
    private String name;

    @ApiModelProperty("当前页")
    private Integer page;

    @ApiModelProperty("每页条数")
    private Integer size;

    public void checkParam() {
        if (this.page == null || this.page < 0) {
            setPage(1);
        }
        if (this.size == null || this.size < 10 || this.size > 100) {
            setSize(10);
        }
    }
}
